<?php
namespace app\index\controller;

use app\common\lib\Util;
use app\common\lib\Predis;


class Index
{
    public function index()
    {
		echo "index";
    }
	
	public function add(){
		echo time();
	}
	
	/**
	*	登陆设置
	*	
	*/
	public function login(){
		$phone_num = $_POST['phone_num'];
		$code = $_POST['code'];
		
		if(empty($phone_num) || empty($code)){
			Util::show(0,"错误信息");
			return "";
		}
		
		try {
            $redisCode = Predis::getInstance()->get(Rekey::smsKey($phone_num));
        }catch (\Exception $e) {
            echo $e->getMessage();
        }
		
		
		echo $redisCode ."==".$code;
		
		
	}
	
}
